package uplb.ics.cs190.e2d.util;

/**
 * The <code>Collection</code> interface provides the basic
 * functionality that a collection of object can perform. This
 * include putting and getting elements.
 * 
 * This interface is created to support portability across
 * the limited collection class of J2ME.
 * 
 * @author Acer
 *
 */
public interface Collection {

	/**
	 * Put an element into the collection.
	 * 
	 * @param tag	the string tag for the added element.
	 * @param object	the object to be added.
	 */
	public void put(String tag, Object object);
	
	/**
	 * Remove an element from the collection.
	 * 
	 * @param tag	the tag of the element to be remove.
	 * @return	true if element is successfully removed.
	 */
	public boolean remove(String tag);
	
	/**
	 * Returns the current number of elements in the collection.
	 * 
	 * @return	the number of elements.
	 */
	public int count();
	
	/**
	 * Remove all the elements in this collection.
	 */
	public void removeAll();
	
	/**
	 * Return an element of the specified tag.
	 * 
	 * @param tag	the name of the element.
	 * @return	the element with same tag as the specified.
	 */
	public Object get(String tag);
	
	/**
	 * Returns if the collection is empty.
	 * 
	 * @return true if the collection is empty.
	 */
	public boolean isEmpty();
		
	public boolean contains(Object object);
	
	public boolean containsTag(String tag);
}